Skip to content

🎨 Refactor internals + bump deps (post-audit cleanup)#13

Merged
bdsoha merged 2 commits into
mainfrom
2026-q2-15-ws-cli-refactors
May 19, 2026
Merged

🎨 Refactor internals + bump deps (post-audit cleanup)#13
bdsoha merged 2 commits into
mainfrom
2026-q2-15-ws-cli-refactors

Conversation

@bdsoha
Copy link
Copy Markdown
Member

@bdsoha bdsoha commented May 19, 2026

Story 2026-q2-15-ws-cli-refactors β€” five internals smells from Nelson's 2026-05-13 audit, bundled for one release.

Refactors

  • server: host:port via net.JoinHostPort (correct IPv6 bracketing); extracted formatAddr for testability.
  • path: slash-run regex hoisted to package-level var β€” no per-call recompile.
  • config: bespoke envref cache (cacheMu/cachedPath/cachedVal/cachedErr) dropped entirely; LoadEnvReference() re-reads each call (dissolves the 2026-q2.12 stale-cache finding).
  • logger: Log/Pipe varβ†’func; cmd/log tests rewritten to writer-injection.
  • show: ip internal/ip node collapsed into a makeIPCmd factory taking a func() (string, error) getter; --raw moved to ShowCmd.PersistentFlags() (inherited by every leaf).

Also

  • Go directive 1.25.8 β†’ 1.26.2; go.mod/go.sum dependency refresh (bundled per maintainer decision).
  • Version β†’ 0.0.55.

Surface

Β§11 frozen surface unchanged β€” no subcommand rename, no exit-code or stderr-text change. Sole delta: show env … --raw no longer errors unknown flag (inherited-but-ignored; intended, pinned by TestShow_RawFlagInheritedByAllLeaves).

go vet ./..., go build ./..., go test ./... all clean.

bdsoha added 2 commits May 19, 2026 07:20
Five internals smells from the 2026-05-13 audit, bundled for one release:

- server: host:port via net.JoinHostPort (correct IPv6 bracketing)
- path: hoist slash-run regex to package-level var (no per-call compile)
- config: drop bespoke envref cache (re-reads override each call)
- logger: Log/Pipe var→func for writer-injection in tests
- show: collapse ip internal/node into makeIPCmd factory; --raw moved
  to ShowCmd.PersistentFlags() (inherited by every leaf)

Also bumps the Go directive to 1.26.2 and refreshes go.mod/go.sum
dependencies. Version β†’ 0.0.55.
The go.mod directive is now 1.26.2. Bump actions/setup-go to 1.26.x
on both jobs and golangci-lint to v2.12.2 (first line built with
go1.26) so the pre-commit lint hook can target the module.
@bdsoha bdsoha merged commit 38ca8fa into main May 19, 2026
3 checks passed
@bdsoha bdsoha deleted the 2026-q2-15-ws-cli-refactors branch May 19, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant